package com.gdqy.FCS.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.gdqy.FCS.dao.DemandDao;
import com.gdqy.FCS.entity.Demand;

@Service
@Transactional
public class DemandService {
	@Autowired
	private DemandDao demandDao;
	
	public int insert(Demand demand){
		return demandDao.insert(demand);
		
	}
	
	
	public int update(Demand demand){
		return demandDao.update(demand);
	}
	//通过id查询作品
	public Demand selectById(int demand_id){
		return demandDao.selectById(demand_id);
	}
	//通过设计师id查询购买需求
	public List<Demand> selectByDesigner_id(int designer_id){
		return demandDao.selectByDesigner_id(designer_id);
	}
	//通过作品id查询购买需求
	public List<Demand> selectByDesign_id(int design_id){
		return demandDao.selectByDesign_id(design_id);
	}
	//通过id删除作品
	public int deleteById(int demand_id){
		return demandDao.deleteById(demand_id);
	}
}
